<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div></div>
  <script>
    // 模拟data
    const data = {
      msg: 'hello world',
      count: 1000,
      name: 'abc'
    }
    // 模拟vue实例  
    const vm = new Proxy(data, {
      get(target, key) {
        console.log('get执行了')
        return target[key]
      },
      set(target, key, newVal) {
        console.log('set执行了')
        target[key] = newVal
        document.querySelector('div').innerText = target[key]
      }
    })
  </script>
</body>

</html>